package com.jingdianjichi.practice.api.enums;

/**
 * ClassName:CompleteStatusEnum
 * Package:com.jingdianjichi.practice.api.enums
 * Description:
 *
 * @Author fst
 * @Create 2025/1/18 20:58
 * @Version 1.0
 */
public enum CompleteStatusEnum
{
    UN_COMPLETE(0, "未完成"),
    COMPLETE(1, "已完成");

    private Integer code;
    private String desc;

    CompleteStatusEnum(Integer code, String desc)
    {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode()
    {
        return code;
    }

    public String getDesc()
    {
        return desc;
    }

    public static CompleteStatusEnum getEnumByCode(Integer code)
    {
        for (CompleteStatusEnum completeStatusEnum : CompleteStatusEnum.values())
        {
            if (completeStatusEnum.getCode().equals(code))
            {
                return completeStatusEnum;
            }
        }
        return null;
    }
}
